package com.sina.shop.service.admin;

import com.sina.shop.domain.admin.Admin;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * Created with IntelliJ IDEA.
 * Description: 调用服务，并配置断路器，当调用出错时调用默认的配置。
 * 段浩杰   2018-01-31-17:40
 */
@FeignClient(value = "SHOP-SPRING-CLOUD-ALL", fallback = AdminServiceBack.class)
public interface AdminService {

    @RequestMapping(value = "/admin/getAdmin", method = RequestMethod.GET)
    Admin getAdmin(@RequestParam("account") String account);

    @RequestMapping(value = "/admin/getAdmin1", method = RequestMethod.GET)
    Admin getAdmin1(@RequestParam("account") String account);

    @RequestMapping(value = "/admin/saveAdmin", method = RequestMethod.POST)
    Admin saveAdmin(@RequestBody(required = false) Admin admin);

    @RequestMapping(value = "/admin/updateAdmin", method = RequestMethod.POST)
    Admin updateAdmin(@RequestBody(required = false) Admin admin);

}
